Disc drives are data storage devices that store digital data in magnetic form on a rotating storage medium called a disc. Modern disc drives comprise one or more rigid discs that are coated with a magnetizable medium and mounted on the hub of a spindle motor for rotation at a constant high speed. Each surface of a disc is divided into several thousand tracks that are tightly-packed concentric circles similar in layout to the annual growth rings of a tree. The tracks are typically numbered starting from zero at the track located outermost the disc and increasing for tracks located closer to the center of the disc. Each track is further broken down into sectors. A sector is normally the smallest individually addressable unit of information stored in a disc drive and typically holds 512 bytes of information plus a few additional bytes for internal drive control and error detection and correction. This organization of data allows for easy access to any part of the discs.
Generally, each of the multiple discs in a disc drive has associated with it two heads (one adjacent the top surface of the disc, and another adjacent the bottom) for reading and writing data to a sector. A typical disc drive has two or three discs. This usually means there are four or six heads in a disc drive carried by a set of actuator arms. Data is accessed by moving the heads from the inner to outer part of the disc (and vice-versa) driven by an actuator assembly. The heads that access sectors on discs are locked together on the actuator assembly. For this reason, all the heads move in and out together and are always physically located at the same track number (e.g., it is impossible to have one head at track 0 and another at track 500). Because all the heads move together, each of the tracks on all discs is known as a cylinder for reasons that these tracks form a cylinder since they are equal-sized circles stacked one on top of the other in space. So, for example, if a disc drive has four discs, it would normally have eight heads, and a cylinder number 680 would be made up of a set of eight tracks, one per disc surface, at track number 680. Thus, for most purposes, there is not much difference between tracks and cylinders since a cylinder is basically a set of all tracks whereat all the heads are currently located.
One of the heads must first be positioned over the correct location of a sector on the disc in order to access (i.e., read or write) the sector. This requires the heads to move to the correct track and then wait for the correct sector to pass under the appropriate head. Moving the heads to the correct track is measured by seek time. Waiting for a correct sector to pass under the appropriate head is measured by latency. Seek time and latency are two very important disc drive performance measurements. Seek time measures the amount of time required for the heads to move between tracks. Generally, the amount of time to switch between two tracks depends on the distance between the tracks; however, the relationship is not linear due to a certain amount of overhead involved in track switching. Latency, on the other hand, measures the time that the disc drive must wait for the correct sector to come around to where one of the heads is waiting for it. At the time the appropriate head arrives at and begins to follow the correct track, the actual sector for read or write may be located elsewhere on the disc spinning around at high speed. This causes a latency delay since the servo system must wait for the correct sector to arrive under the head.
A seek time delay and a latency delay are normally expressed in milliseconds. In a computing system, a millisecond is an enormous amount of time when the system memory speed is measured in nanoseconds. For example, a 200 MHz processor can theoretically execute 200,000 instructions in a millisecond. Thus, cutting the seek time and/or latency delays result in significant performance improvement in a computing system, because the computing system can execute a significant number of instructions instead of waiting for movement of the heads to a track or waiting for a correct sector to pass under one of the heads.
Particularly, storing data in a contiguous block of sectors on a track in a disc drive reduces latency. For example, latency is relatively a minor factor for reading or writing a large contiguous block of data on a track since the latency will only occur once while waiting to access the first sector of data. On the other hand, latency is an important performance-limiting factor for reading or writing noncontiguous multiple data blocks on a track.
Every sector in a disc drive is a good sector in an ideal world; however, typical disc drives contain unusable sectors when they are manufactured, because it is virtually impossible to create a disc drive with several million sectors and not have some errors. Imperfections in the media coating on the disc or other problems, for example, may make a sector inoperable. This usually shows up as an error when attempting to read the sector. Modern disc drives use an error correction code to help identify when errors occur and in some cases to correct them; however, there will still be physical flaws that prevent parts of a disc from being used. These unusable sectors, due to such physical flaws, are called defective sectors.
When defective sectors are discovered in the data storage area of a disc drive, each of the memory locations corresponding to the defective sectors are mapped to a good sector in another part of the data storage area. For this mapping purpose, spare sectors are reserved in a disc drive as substitutes for those defective sectors. Typically, each track has one spare sector at the end of the track. A disc drive controller keeps track of all defective sectors in the disc drive and automatically substitutes each of the defective sectors with a spare sector. When a host controller sends a command to read data from or write data to a defective sector, the disc drive controller seeks to the designated substitute sector taken from the pool of spare sectors rather than seeking to the defective sector. This technique is known as spare sectoring (or defect mapping) and causes defective sectors to be transparent to a user. In selecting a spare sector as a substitute, the disc drive controller always tries to use the spare sector on the same track to avoid a seek time delay associated with track switching. Nevertheless, a seek time delay cannot be avoided if more defective sectors are present on the track than available spare sectors on that track. Moreover, in most cases, mapping a defective sector to a spare sector causes fragmentation of data. Once data is fragmented, each fragment of data introduces a latency delay to locate the beginning sector of each fragment and, if the next fragment starts on a different track, an additional seek time delay is introduced. Thus, there is a big performance difference between accessing data that is laid out contiguously on a disc and accessing data that is fragmented into a dozen pieces. In any case, greater seek time and/or latency causes slower access to data stored in a disc drive.
Typically in a disc drive, as data to be written or read to or from the drive is transferred from a host computer to or from the drive, the data is stored into a temporary buffer located on the drive. The data is more importantly stored in the buffer in the order in which it was received from either the host computer or the drive media itself. The data is also then transferred from the buffer to the disc or host computer in the same order.
Also, as mentioned above, each track in a disc drive is further partitioned into sectors that are typically arranged sequentially. That is, each sector on a track is adjacent to the previous and next sector. For example, sector 13 would be positioned between sector 12 and 14. This configuration is optimal for many reasons, one such reason being to maintain efficiency during an access of a large block of contiguous data. In such a case, since the sectors are positioned sequentially on a track, and since the data in the buffer is sequential and contiguous, performance is optimal. This is because once the head has seeked to the starting sector for transfer, the data in the buffer can simply be transferred directly to or from the disc, sector by sector. However, during typical operation, commands are rarely sent which access data in large sequential, contiguous blocks. For example, a host may send data for sectors 10 through 15 in the order of: 13-15-12-10-11-14, one sector at a time. Moreover, due to setup time of the disc drive firmware to process and handle incoming commands, the disc may rotate beyond a sector which is to be accessed according to the incoming commands. In this case, latency becomes a significant performance-reducing factor because even though all sectors may be located on the same track (thus seek time not being a performance issue), they are not in order, or may have rotated beyond head during the current disc rotation. Consequently, the disc must rotate several times to access the data as it transfers a sector at a time from the buffer to the disc.
In a disc drive, errors are sometimes encountered during the transfer of data. Any error detection mechanism known in the art may be employed to detect an error. Recovery from an error is relatively straightforward. There are essentially two pointers into the buffer; one pointer specifies where the host may next access buffer data, and the other pointer specifies where the disc may next access buffer data. Since the data in the buffer is continuous and sequential, the firmware can simply calculate based on the pointer locations and amount of data transferred, what to reset the pointers to, to repeat a transfer.
Accordingly there is a need for a mechanism which reduces the number of disc rotations needed on a transfer of non-sequential, and/or non-contiguous data from between a host computer and a disc drive. This mechanism will complicate the error recovery scheme, and will necessitate an enhanced buffer management technique to compensate.